#ifndef MAP_H
#define MAP_H

#include <QObject>
#include <QWebView>
#include <QLineEdit>

class QNetworkReply;
class QNetworkAccessManager;

class Map : public QObject
{
    Q_OBJECT
public:
    explicit Map(QWebView *tmapview, QLineEdit *tmapline, QObject *parent = 0);

protected:
    void changeEvent(QEvent *e);

private:
    QString longitude;
    QString latitude;
    QWebView *mapview;
    QLineEdit *mapline;
    int zoomLevel;
    QStringList coordinateStrList;
    QNetworkAccessManager* manager;
    QString jQuery;

    void loadUrl(const QString url);
    void showProgressBar(bool visible);
    void zoom();

signals:
    void changeReceived(QEvent *e);
    
public slots:

private slots:
    void on_webView_loadFinished(bool );
    void on_buttonSearch_pressed();
    void on_buttonZoomOut_pressed();
    void on_buttonZoomIn_pressed();
    void on_webView_urlChanged(QUrl url );
    void on_webView_iconChanged();
    void on_webView_titleChanged(QString title);
    void on_lineEdit_returnPressed();
    void finished(QNetworkReply *reply);
    void populateJavaScriptWindowObject();
    void on_tabWidget_selected(const QString &arg1);
};

#endif // MAP_H
